<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>08_定位的特殊应用2</title>
    <style>
      .outer {
        width: 800px;
        height: 400px;
        background-color: #888;
        position: relative;
      }
      .inner {
        width: 400px;
        height: 100px;
        background-color: orange;
        font-size: 20px;
        position: absolute;
        /* 实现inner盒子在outer中水平垂直居中 */

        /* 方案一 */
        /* left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto; */

        /* 方案二 */
        left: 50%;
        top: 50%;
        margin-left: -200px;
        margin-top: -50px;
      }
    </style>
  </head>

  <body>
    <img src="../../images/ding-wei.png" alt="" />
    <div class="outer">
      <div class="inner">你好啊</div>
    </div>
  </body>
</html>
